#!/usr/bin/env python
#coding: utf8

__author__ = 'Исаков Владислав'
__project_name__ = 'isakov-selenium-python'
__date__ = '08.04.14'

import time
from selenium.webdriver.common.keys import Keys


def bad_search(driver):
    search_input = driver.find_element_by_xpath(".//*[@id='q']")
    assert search_input.is_displayed() & search_input.is_enabled()
    search_word = "test"
    search_input.send_keys(search_word)
    search_input.send_keys(Keys.RETURN)
    time.sleep(1)

    try:
        result = driver.find_element_by_xpath(".//*[@id='results']/div[1]")
        assert result.text == "No movies where found."
        print "Good! " + "No movies where found."
    except:
        print "False!"